/*
 * VK_Q1.cxx
 *
 *  Created on: 10:51:32 AM Oct 29, 2012
 *      Author: Pallab
 * "I have not failed, I have just found 10000 ways that won't work.
 */

#include <iostream>
#include <algorithm>
#include <vector>
#include <sstream>
#include <fstream>
#include <string>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <numeric>
#include <stack>
#include <functional>
#include <bitset>
#include <iomanip>

#include <ctime>
#include <cassert>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <climits>
#include <cstring>
#include <cstdlib>

using namespace std;

#define foR(i1,st,ed) for(int i1 = st , j1 = ed ; i1 < j1 ; ++i1 )
#define fo(i1,ed) foR( i1 , 0 , ed )
#define foE(i1,st,ed) foR( i1, st, ed+1 )
#define foit(i, x) for (typeof((x).begin()) i = (x).begin(); i != (x).end(); i++)
#define bip system("pause")
#define Int long long
#define pb push_back
#define SZ(X) (int)(X).size()
#define LN(X) (int)(X).length()
#define mk make_pair
#define SET( ARRAY , VALUE ) memset( ARRAY , VALUE , sizeof(ARRAY) )
#define line puts("")

inline void wait(double seconds) {
	double endtime = clock() + (seconds * CLOCKS_PER_SEC);
	while (clock() < endtime) {
		;
	}
}
#define T int
inline T fastIn() {
	register char c = 0;
	register T a = 0;
	bool neg = false;
	while (c < 33)
		c = getchar();
	while (c > 33) {
		if (c == '-') {
			neg = true;
		} else {
			a = (a * 10) + (c - '0');
		}
		c = getchar();
	}
	return neg ? -a : a;
}
inline void read();
inline void proc();
struct Node {
	int key, priority, size;
	Node* left, *right;
	Node(int k, int p) :
			key(k), priority(p), left(NULL), right(NULL), size(1) {
	}
	Node(int k) :
			key(k), left(NULL), right(NULL), priority(rand()), size(1) {
	}
};
inline int sz(Node *root) {
	if (root == NULL)
		return 0;
	return root->size;
}
inline void upd(Node *root) {
	if (root != NULL) {
		root->size = 1 + sz(root->left) + sz(root->right);
	}
	return;
}
Node* search(Node *root, int key) {
	if (root == NULL)
		return NULL;
	if (key < root->key)
		return search(root->left, key);
	if (key > root->key)
		return search(root->right, key);
	return root;
}
Node* rotRight(Node *root) {
	Node* pivot = root->left;
	root->left = pivot->right;
	pivot->right = root;
	upd(root->right), upd(root);
	return pivot;
}

Node* rotLeft(Node *root) {
	Node* pivot = root->right;
	root->right = pivot->left;
	pivot->left = root;
	upd(root->left), upd(root);
	return pivot;
}
Node* insert(Node *root, Node *novo) {
	if (root == NULL)
		return novo;
	if (root->key < novo->key) {
		root->right = insert(root->right, novo);
		if (root->right->priority > root->priority)
			root = rotLeft(root);
	} else {
		root->left = insert(root->left, novo);
		if (root->left->priority > root->priority)
			root = rotRight(root);
	}
	upd(root);
	return root;
}

Node* erase(Node* root, int key) {
	if (root == NULL) {
		return root;
	}
	if (root->key < key)
		root->right = erase(root->right, key);
	else if (root->key > key)
		root->left = erase(root->left, key);
	else {
		if (root->left != NULL) {
			if (root->right != NULL) {
				if (root->left->priority < root->right->priority) {
					root = rotLeft(root);
					root->left = erase(root->left, key);
				} else {
					root = rotRight(root);
					root->right = erase(root->right, key);
				}
			} else {
				Node* aux = root->left;
				delete root;
				return aux;
			}
		} else {
			if (root->right != NULL) {
				Node* aux = root->right;
				delete root;
				return aux;
			} else {
				delete root;
				return NULL;
			}
		}
	}
	upd(root);
	return root;
}
Node * Find_kth_Node(Node *root, int k) {
	if (sz(root) < k)
		return NULL;
	int ans = 1 + sz(root->left);
	if (ans == k)
		return root;
	if (ans < k)
		return Find_kth_Node(root->right, k - ans);
	return Find_kth_Node(root->left, k);
}
int count_less(Node *root, int k) {
	if (root == NULL)
		return 0;
	if (root->key < k) {
		return 1 + sz(root->left) + count_less(root->right, k);
	}
	return count_less(root->left, k);
}
Node* clear(Node* root) {
	if (root != NULL) {
		clear(root->left);
		clear(root->right);
		delete root;
	}
}

void Traverse(Node *root, int level) {
	if (root == NULL)
		return;
	printf("[%d = > %d,%d,%d]->\n", level, root->key, root->priority,
			root->size);
	Traverse(root->left, level + 1);
	Traverse(root->right, level + 1);
}

int main() {
	int kase = 1;
#if defined( xerxes_pc )
	if (!freopen("in1", "r", stdin))
		puts("error opening file in "), assert(0);
	kase = 1;
#endif
	fo(i,kase)
	{
		read();
		proc();
	}
	return 0;
}
const int MX = 200010;
int cnt[26];
bool good[MX];
inline void proc() {
	Node* treap[26];
	fo(i,26)treap[i]=NULL;

	string tmp,ss="";
	int k=fastIn();
	cin>>tmp;
	while(k--)ss+=tmp;
	fo(i,LN(ss)){
		int id=ss[i]-'a';
		cnt[id]++;
		treap[id] = insert(treap[id], new Node(i+1) );
	}
	/*cout<<ss<<'\n';
	fo(i,26){
		if(cnt[i]){
			Traverse(treap[i],0);
			puts("-----------");
		}
	}*/
	SET(good,true);
	int q=fastIn(),v;
	char ch;
	while(q--){
		cin>>v>>ch;
		//find kth element from the treap
		int id = ch-'a';
		Node * aux = Find_kth_Node(treap[id], v);
		if(aux!=NULL){
			//cout<<aux->key<<' '<<aux->size<<'\n';
			good[aux->key-1]=false;
			treap[id] = erase(treap[id], aux->key);
		}
		else{
			//cout<<"invalid\n";
			assert(0);
		}
	}
	fo(i,26){
		clear(treap[i]);
	}
	fo(i,LN(ss))if(good[i])cout<<ss[i];
	line;
}
//unused
inline void read() {
}
